package singleton;

/**
 * @author wcj
 * @Date 2021/6/19 20:07
 * @Version 1.0
 */
public class StaticClassSingleton {

 private static class SingletonHolder {
  private static StaticClassSingleton singleton = new StaticClassSingleton();
 }

 private StaticClassSingleton() {
 }

 /**
  * 静态内部类形式的单例模式
  *
  * @return
  */
 public static StaticClassSingleton getInstance() {
  return SingletonHolder.singleton;
 }
}
